package com.spring4a.stereo_xmlconfig.soundsystem.collections;

import com.spring4a.stereo_xmlconfig.soundsystem.CompactDisc;

import java.util.List;

/**
 * Created by Temp on 2017/9/18.
 */
public class Discography  {
    private  String artist;
    private List<CompactDisc> cd;

    public Discography(String artist, List<CompactDisc> cd) {
        this.artist = artist;
        this.cd = cd;
    }

    public void play() {
        System.out.println("Playing " + artist + " by " + artist);
        for (CompactDisc compactDisc : cd) {
            compactDisc.play();
            System.out.println("-构造器对象: " + artist);
        }
    }
}
